package com.tn.shirojwt.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: tn
 * @time: 2020/3/16 20:53
 */
@RestController
@RequestMapping("/user")
public class UserController {

    /**
     * 用户查询
     * @RequiresPermissions("user:view") //权限管理;
     * @return
     */
    @GetMapping("/userList")
    @RequiresPermissions("user:view")
    public String userInfo(){
        return "userList";
    }

    /**
     * 用户添加
     *  @RequiresPermissions //权限管理;
     * @return
     */
    @GetMapping("/userAdd")
    @RequiresPermissions("user:add")
    public String userInfoAdd(){
        return "userAdd";
    }

    /**
     * 用户删除
     * RequiresPermissions 权限管理;
     * @return
     */
    @GetMapping("/userDel")
    @RequiresPermissions("user:del")
    public String userDel(){
        return "userDel";
    }

    /**
     * 用户测试
     *  @RequiresPermissions //权限管理;
     * @return
     */
    @GetMapping("/userTest")
    @RequiresPermissions("user:test")
    public String userInfoTest(){
        return "userTest";
    }
}
